package com.example.token_localstorage.token;

import ch.qos.logback.classic.util.LogbackMDCAdapter;
import com.example.token_localstorage.u.User;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;

import java.util.HashMap;
import java.util.Map;

@Data
public class Result {
    private Integer code; //处理
    private String message;
    private Integer status;
    @Getter@Setter
    private String token;
    private Map<String, Object> extended = new HashMap<>();

    public Result() {
    }

    public Result(Integer code, String message, Integer status, String token) {
        this.code = code;
        this.message = message;
        this.status = status;
        this.token = token;
    }

    public Result addObject(String key, Object value) {
        this.extended.put(key, value);
        return this;
    }
}
